<script>
	export default {
		created() {
			// 禁止页面缩放
			window.onload = function () {
				document.addEventListener('dblclick', function(event) {
				  event.preventDefault(); // 禁止双击默认事件
				}, false);
				document.addEventListener("touchstart", function (event) {
				if (event.touches.length > 1) {
					event.preventDefault();
				}
				});
				document.addEventListener("gesturestart", function (event) {
					event.preventDefault();
				});
			};
		},

		onLaunch: function() {

			// 页面拦截tabbar，非登录状态页首页跳转登录页登录
			uni.addInterceptor('switchTab', {
				// tabbar页面跳转前进行拦截
				invoke(e) {
					if (e.url == "/pages/lobby/index") {
						uni.showToast({
							title: '即将开放',
							duration: 1000,
							icon: 'none'
						});
						return false
					} else {
						return true
					}
				},
				success(e) {
					// console.log(e)
				}
			})
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	@import url("pages/common/app.css");

	body {
		background-color: #f0f3ff !important;
		font-size: 3.46667vw;
		color: #535d76;
	}

	uni-toast {
		z-index: 10000002;
	}
</style>